home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / mac / hypercar / hamradio / extra23.sit / Extra Ham Test / background_2725.txt < prev    next >
Text File  |  1991-04-08  |  7KB  |  231 lines

  1. -- background: 2725 from stack: in
  2. -- bmap block id: 3199
  3. -- flags: 4000
  4. -- background id: 0
  5. -- name: intro
  6. ----- HyperTalk script -----
  7. on buildList -- ΓÇóΓÇóΓÇó rename to buildList1 if using sequential questions
  8.   -- or to buildList if using randomly-generated questions
  9.   global questlist,rightone,lockkey,questans,questkey
  10.   global sky1, sky2, sky3, sky4, sky5, sky6 -- used for saved ans key
  11.   -- initialization
  12.   set the cursor to 4
  13.   -- ΓÇóΓÇóΓÇóquestgrp contains the number of questions in each question group
  14.   -- and is used to generate random questions, one from each group.
  15.   -- Note that the question groups MUST BE sequential in order for this
  16.   -- to work.  That is, group 1 must be the first 10 questions, group 2
  17.   -- must be the next 14 questions, and so on.
  18.   put "15,15,12,15,18,14,13,15,7,5," into questgrp
  19.   put "4,5,7,5,5,4,8,10,14,11," after questgrp
  20.   put "11,9,10,10,9,12,9,6,19,18," after questgrp
  21.   put "19,13,12,10,9,13,9,16,11,13" after questgrp
  22.   -- ΓÇóΓÇóΓÇó The number of commas in questans and questkey must be equal to
  23.   -- number of questions in each test minus one.  For example, for a
  24.   -- 40-question test, there are 39 commas.
  25.   put ",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,," into questans
  26.   put ",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,," into questkey
  27.   put empty into questlist
  28.   put 0 into startgroup
  29.   put empty into sky1
  30.   put empty into sky2
  31.   put empty into sky3
  32.   put empty into sky4
  33.   put empty into sky5
  34.   put empty into sky6
  35.   set lockscreen to true
  36.   -- generate the questions from subgroups randomly
  37.   repeat with i = 1 to number of items of questgrp
  38.     put startgroup into thisquest
  39.     add the random of item i of questgrp to thisquest
  40.     put questlist & "#" & thisquest & "," into questlist
  41.     add item i of questgrp to startgroup
  42.   end repeat
  43.   delete last character of questlist
  44.   -- ΓÇóΓÇóΓÇó generate the answer key for these questions.  this currently
  45.   -- only handles up to first 51 questions.
  46.   repeat with i = 1 to number of items of questlist
  47.     if i > 51 then exit repeat
  48.     put item i of questlist into thisquest
  49.     go to card thisquest
  50.     -- ΓÇóΓÇóΓÇó You can put the card # or the subelement #  or question #
  51.     -- as question #in key
  52.     put "#" & i into x -- question # option
  53.     -- put the short name of this card into x -- card # option
  54.     -- put first word of field "Q1" into x -- subelement # option
  55.     put first word of field "Q1" into y -- used for answer key
  56.     if i < 18 then
  57.       put sky1&x&"("&y&")"&return into sky1
  58.       put sky2&rightone&return into sky2
  59.     else if i < 35 then
  60.       put sky3&x&"("&y&")"&return into sky3
  61.       put sky4&rightone&return into sky4
  62.     else
  63.       put sky5&x&"("&y&")"&return into sky5
  64.       put sky6&rightone&return into sky6
  65.     end if
  66.   end repeat
  67.   go to card savedscores
  68.   put sky1 into field key1
  69.   put sky2 into field key2
  70.   put sky3 into field key3
  71.   put sky4 into field key4
  72.   put sky5 into field key5
  73.   put sky6 into field key6
  74.   -- prevent buildList from being called again immediately
  75.   put true into lockkey
  76.   go to first card
  77.   set lockscreen to false
  78. end buildList
  79.  
  80. on buildList1 -- ΓÇóΓÇóΓÇó rename to buildList for sequential questions or to
  81.   -- buildList1 for randomly-generated questions
  82.   global questlist,rightone,lockkey,questans,questkey
  83.   global sky1, sky2, sky3, sky4, sky5, sky6 -- used for saved ans key
  84.   -- initialization
  85.   set the cursor to 4
  86.   -- ΓÇóΓÇóΓÇó be sure that the group number of each question card matches the
  87.   -- question number.  For example, question #1 is group 1, question
  88.   -- #2 is group 2, and so on.
  89.   put empty into questlist
  90.   put empty into questans
  91.   put empty into questkey
  92.   put empty into sky1
  93.   put empty into sky2
  94.   put empty into sky3
  95.   put empty into sky4
  96.   put empty into sky5
  97.   put empty into sky6
  98.   set lockscreen to true
  99.   repeat with i = 1 to number of cards of bkgnd Test
  100.     put "#" & i & "," after questlist
  101.     put "," after questans
  102.     put "," after questkey
  103.   end repeat
  104.   delete last character of questlist
  105.   delete last character of questans
  106.   delete last character of questkey
  107.   -- ΓÇóΓÇóΓÇó generate the answer key for these questions.  This currently
  108.   -- only works for first 32 questions
  109.   repeat with i = 1 to number of items of questlist
  110.     if i > 51 then exit repeat
  111.     put item i of questlist into thisquest
  112.     go to card thisquest
  113.     -- ΓÇóΓÇóΓÇó You can put the card # or the subelement #  or question # -- as question #in key
  114.     -- put "#" & i into x -- question # option
  115.     put the short name of this card into x -- card # option
  116.     -- put first word of field "Q1" into x -- subelement # option
  117.     put first word of field "Q1" into y -- used for answer key
  118.     if i < 18 then
  119.       put sky1&x&"("&y&")"&return into sky1
  120.       put sky2&rightone&return into sky2
  121.     else if i < 35 then
  122.       put sky3&x&"("&y&")"&return into sky3
  123.       put sky4&rightone&return into sky4
  124.     else
  125.       put sky5&x&"("&y&")"&return into sky5
  126.       put sky6&rightone&return into sky6
  127.     end if
  128.   end repeat
  129.   go to card savedscores
  130.   put sky1 into field key1
  131.   put sky2 into field key2
  132.   put sky3 into field key3
  133.   put sky4 into field key4
  134.   put sky5 into field key5
  135.   put sky6 into field key6
  136.   -- prevent buildList from being called again immediately
  137.   put true into lockkey
  138.   go to first card
  139.   set lockscreen to false
  140. end buildList1
  141.  
  142.  
  143.  
  144. -- part 1 (button)
  145. -- low flags: 00
  146. -- high flags: 0000
  147. -- rect: left=111 top=169 right=309 bottom=228
  148. -- title width / last selected line: 0
  149. -- icon id / first selected line: 0 / 0
  150. -- text alignment: 1
  151. -- font id: 0
  152. -- text size: 12
  153. -- style flags: 0
  154. -- line height: 16
  155. -- part name: Exam
  156. ----- HyperTalk script -----
  157. on mouseDown
  158.   ask "Please enter your name."
  159.   put it into field "user" of card report
  160.   -- ΓÇóΓÇóΓÇó change unlimited to # minutes to put a time limit on test
  161.   -- be sure to change background of questions and below also.
  162.   answer "You have unlimited minutes to take this test" with "OK"
  163. end mouseDown
  164.  
  165. on mouseUp
  166.   global time1,score,check2,ok,questlist
  167.   set the cursor to 4
  168.   put empty into ok
  169.   put empty into score
  170.   put empty into check2
  171.   put empty into field QMissed of card report
  172.   get the long time
  173.   put it into field "Start" of Card "Report"
  174.   convert it to seconds
  175.   -- ΓÇóΓÇóΓÇó change 30 in next line to # of minutes desired for time limit
  176.   add 30*60 to it
  177.   put it into time1
  178.   -- put questlist into message -- for debug only
  179.   visual effect dissolve to black
  180.   visual effect dissolve
  181.   -- go card "#1" -- for debug only
  182.   get item 1 of questlist
  183.   go card it
  184. end mouseUp
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192. -- part 2 (button)
  193. -- low flags: 00
  194. -- high flags: 0000
  195. -- rect: left=27 top=47 right=85 bottom=71
  196. -- title width / last selected line: 0
  197. -- icon id / first selected line: 1011 / 1011
  198. -- text alignment: 1
  199. -- font id: 0
  200. -- text size: 12
  201. -- style flags: 0
  202. -- line height: 16
  203. -- part name: Home
  204. ----- HyperTalk script -----
  205. on mouseUp
  206.   visual effect iris close
  207.   go home
  208. end mouseUp
  209.  
  210.  
  211.  
  212.  
  213. -- part 4 (button)
  214. -- low flags: 00
  215. -- high flags: 0000
  216. -- rect: left=431 top=55 right=94 bottom=472
  217. -- title width / last selected line: 0
  218. -- icon id / first selected line: 14767 / 14767
  219. -- text alignment: 1
  220. -- font id: 0
  221. -- text size: 12
  222. -- style flags: 0
  223. -- line height: 16
  224. -- part name: Tell Me About...
  225. ----- HyperTalk script -----
  226. on mouseUp
  227.   push this card
  228.   visual effect iris open
  229.   go to card "About...."
  230. end mouseUp
  231.